{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "bf3ada5a-4020-4524-993a-b22160e057d1",
   "metadata": {},
   "outputs": [],
   "source": [
    "from AD9910 import AD9910\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "992d319a-85e4-4b47-a99c-02b37d5a309b",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = AD9910()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "5ed745f8-7111-4f6f-b454-ee418e92d9e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-1803687520"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.DLL.AD9910_Open()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "0d157f75-cc72-46d7-940d-3c63068c189a",
   "metadata": {},
   "outputs": [],
   "source": [
    "a.DDS_Init([1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "c205eb30-da9d-4c99-ae32-97f7361e05fe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.DLL.AD9910_Config(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "0e2caf5d-855b-4c45-80eb-9da067f31faf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "128"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.GetPort0(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "8903817e-4628-44fc-93ae-697c992d6fae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[185, 16, 165, 177, 200, 18]"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.ReadReg(1,6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "ca05613b-e253-40e3-bdb4-887563141cb4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(972610294.3532169, 2.234267228224379, 0.996078431372549)"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.ReadProf(1,0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "19cbed94-491b-4fb9-9c1d-6978f1852ad4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.0, 0.0, 0.0)"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.ReadProf(1,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "497919b1-8fc6-466f-84b4-88d8fdc05789",
   "metadata": {},
   "outputs": [],
   "source": [
    "a.WriteProf(1, 3, 220, 0.5, 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "5a6eb043-da68-474e-96c0-ba210be88625",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(220.0249582529068, 0.5000305194408838, 0.0)"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.ReadProf(1,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "839e075c-de29-4d26-8187-6aa096b03f3a",
   "metadata": {},
   "outputs": [],
   "source": [
    "self.update(ion,amp,freq,phase):\n",
    "    a.WriteProf(1, 3, amp, freq, phase)\n",
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
